package com.example.administrator.service;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.support.annotation.Nullable;



public class Music extends Service {
    private MediaPlayer mplayer;

    @Nullable
    @Override
    public IBinder onBind(Intent intent3) {
        return null;
    }


    public void onStart(Intent intent,int startId){
        super.onStart(intent,startId);
        mplayer = MediaPlayer.create(this, R.raw.huanqin);
        mplayer.start();
    }

    public void onDestory(){
        super.onDestroy();
        mplayer.stop();
    }
}
